home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / irix / tools / strlen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  653 b   |  30 lines

  1. /*----------------------------------------------------------------------
  2.  * $Id: strlen.c,v 1.1 1993/03/04 18:51:20 carlson Exp $
  3.  *
  4.  * Description:
  5.  *    This program returns the length of the 'word' passed on the
  6.  *    command line.
  7.  *
  8.  * Revision History:
  9.  *    $Log: strlen.c,v $
  10.  * Revision 1.1  1993/03/04  18:51:20  carlson
  11.  * Initial revision
  12.  *
  13.  * Revision 1.1  1993/02/24  14:14:17  chris
  14.  * Initial revision
  15.  *
  16.  *----------------------------------------------------------------------*/
  17.  
  18. #include <stdio.h>
  19. #include <errno.h>
  20.  
  21. main (int argc, char *argv[])
  22. {
  23.     register int i = 0;
  24.  
  25.     if (argc > 1)
  26.     i = strlen (argv[1]);
  27.  
  28.     printf ("%d\n", i);
  29. }
  30.